<title>伪静态规则管理</title>

<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">后台首页</a>
    <a><cite>功能管理</cite></a>
    <a><cite>伪静态规则管理</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-header">伪静态规则管理</div>
        <div class="layui-card-body" pad15>
          <blockquote class="layui-elem-quote">特别说明：修改伪静态规则后，需要重启项目服务，才能让配置生效</blockquote>
          <blockquote class="layui-elem-quote">
            <div class="layui-row layui-col-space15">
              <div class="layui-col-md3">
                <h3>方案1：数字模式</h3>
                <div class="">
                  <p>文章详情：/a/{id}.html</p>
                  <p>产品详情：/p/{id}.html</p>
                  <p>分类列表：/c/{id}(/{page})</p>
                  <p>单页详情：/{id}.html</p>
                  <p>文章首页：/a(/{page})</p>
                  <p>文章首页：/p(/{page})</p>
                </div>
              </div>
              <div class="layui-col-md3">
                <h3>方案2：命名模式</h3>
                <div class="">
                  <p>文章详情：/a/{filename}.html</p>
                  <p>产品详情：/p/{filename}.html</p>
                  <p>分类列表：/c/{filename}(/{page})</p>
                  <p>单页详情：/{filename}.html</p>
                  <p>文章首页：/a(/{page})</p>
                  <p>文章首页：/p(/{page})</p>
                </div>
              </div>
              <div class="layui-col-md3">
                <h3>方案3：极简数字模式</h3>
                <div class="">
                  <p>文章详情：/a_{id}.html</p>
                  <p>产品详情：/p_{id}.html</p>
                  <p>分类列表：/c_{id}(_{page})</p>
                  <p>单页详情：/{id}.html</p>
                  <p>文章首页：/a(_{page})</p>
                  <p>文章首页：/p(_{page})</p>
                </div>
              </div>
              <div class="layui-col-md3">
                <h3>方案4：自定义模式</h3>
                <div class="">
                  <p>文章详情：自定义</p>
                  <p>产品详情：自定义</p>
                  <p>分类列表：自定义</p>
                  <p>单页详情：自定义</p>
                  <p>文章首页：自定义</p>
                  <p>文章首页：自定义</p>
                </div>
              </div>
            </div>
          </blockquote>
          <script type="text/html" template lay-url="/plugin/rewrite" lay-done="layui.form.render();">
            <div class="layui-form" style="padding: 20px 0 0 0;">
          <div class="layui-form-item">
            <label class="layui-form-label">选择伪静态方案</label>
            <div class="layui-input-medium">
              <div><input type="radio" name="mode" value="0" {{# if(d.data.mode == 0){ }}checked{{# } }} lay-filter="rewrite-radio" title="方案1：数字模式（简单，推荐）"></div>
              <div><input type="radio" name="mode" value="1" {{# if(d.data.mode == 1){ }}checked{{# } }} lay-filter="rewrite-radio" title="方案2：命名模式（英文或拼音，高端）"></div>
              <div><input type="radio" name="mode" value="2" {{# if(d.data.mode == 2){ }}checked{{# } }} lay-filter="rewrite-radio" title="方案3：极简数字模式（极简，根目录）"></div>
              <div><input type="radio" name="mode" value="3" {{# if(d.data.mode == 3){ }}checked{{# } }} lay-filter="rewrite-radio" title="方案4：自定义模式（高级模式，请谨慎使用，若设置不当，会导致前端页面打不开）"></div>
            </div>
          </div>
          <div id="rewrite-patten-field" class="layui-form-item {{# if(d.data.mode != 3){ }}layui-hide{{# } }}">
            <label class="layui-form-label">自定义伪静态规则</label>
            <div class="layui-input-medium">
              <textarea class="layui-textarea" name="patten" rows="6">{{ d.data.patten || '' }}</textarea>
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-inline">
              <input type="button" lay-submit lay-filter="rewrite-submit" value="确认" class="layui-btn">
            </div>
          </div>
        </div>
        </script>

          <div class="layui-card" style="padding-top: 30px;">
            <div class="layui-card-header">自定义伪静态规则说明</div>
            <div class="layui-card-body">
              <div>请复制下面的规则到输入框里修改,一共6行,分别是文章详情、产品详情、分类、页面、文章首页、产品首页。===和前面部分不可修改。</div>
              <blockquote class="layui-elem-quote">
<pre>
article===/p_{filename}.html
product===/a_{filename}.html
category===/c_{filename}(_{page})
page===/{filename}.html
articleIndex===/articles(_{page})
productIndex===/products(_{page})
</pre>
</blockquote>
              <br>变量由花括号包裹{},如{id}。可用的变量有:数据ID <font color="#009688">{id}</font>、数据自定义链接名 <font color="#009688">
                {filename}</font>、分类自定义链接名 <font color="#009688">{catname}</font>、分类ID <font color="#009688">{catid}
              </font>,分页页码 <font color="#009688">{page}</font>,分页需放在小括号内,如:(/{page})<br>
              <div>可直接使用的方案1:</div>
                <blockquote class="layui-elem-quote">
<pre>
article===/p_{filename}.html
product===/a_{filename}.html
category===/c_{filename}(_{page})
page===/{filename}.html
articleIndex===/articles(_{page})
productIndex===/products(_{page})
</pre>
                </blockquote>
<div>可直接使用的方案2:</div>
<blockquote class="layui-elem-quote">
<pre>
article===/{catname}/a_{filename}.html
product===/{catname}/p_{filename}.html
category===/{filename}(_{page})
page===/{filename}.html
articleIndex===/articles(_{page})
productIndex===/products(_{page})
</pre>
</blockquote>
<div>可直接使用的方案3:</div>
<blockquote class="layui-elem-quote">
<pre>
article===/article/{filename}.html
product===/product/{filename}.html
category===/category/{filename}(_{page})
page===/{filename}.html
articleIndex===/articles(_{page})
productIndex===/products(_{page})
</pre>
</blockquote>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
  layui.use('plugin', layui.factory('plugin'));
</script>